﻿/*
评委会打分 
Time Limit:1000MS  Memory Limit:32768K


Description:
青年歌手大奖赛中，评委会给参赛选手打分。
选手得分规则为去掉一个最高分和一个最低分，然后计算平均得分，请编程输出某选手的得分。

Input:
输入数据有多组，每组占一行，每行的第一个数是n(2<n<100)，表示评委的人数，然后是n个评委的打分。 
Output:
对于每组输入数据，输出选手的得分，结果保留2位小数，每组输出占一行。 
Sample Input:
3 99 98 97
4 100 99 98 97
Sample Output:
98.00
98.50
*/
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
	for (unsigned n; cin >> n;)
	{
		//n>2
		vector<unsigned> credits;
		credits.reserve(n);
		{
			size_t i = 0U;
			for (unsigned credit; i < n; credits.push_back(credit), ++i)
				cin >> credit;
		}

		vector<unsigned>::size_type mid = (n + 1) / 2;
		double total = (n & 0x1) ? credits[mid - 1] : 0;
		for (vector<unsigned>::size_type i = 0, j = n - 1; i < j; ++i, --j)
		{
			total += double(credits[i] + credits[j]);
			if (credits[i] > credits[j])
				swap(credits[i], credits[j]);
		}


	//	cout << total << endl;
		unsigned minimum = *min_element(credits.begin(), credits.begin() + mid);
		unsigned maximum = *max_element(credits.begin() + mid, credits.end());
	//	cout << minimum << ", " << maximum << endl;
		total = total - minimum - maximum;
		cout.precision(2);
		cout << fixed << (total / (n - 2)) << endl;
	}
	return EXIT_SUCCESS;
}